<%@ page import="Navigator.student.StudentDao" %>
<%@ page import="Navigator.student.StudentEnity" %>
<%@ page import="StudentLesson.StudentLessonDao" %>
<%@ page import="java.util.ArrayList" %>
<%@ page import="StudentLesson.StudentLessonEnity" %><%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2020/8/18
  Time: 10:50
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
    <link href="/SystemerNav/SystemerNav.css" rel="stylesheet" type="text/css">
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@3.3.7/dist/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">

</head>
<%
    StudentDao studentDao=new StudentDao();
    StudentEnity studentEnity=studentDao.getStudent(request.getParameter("studentNo"));
    session.setAttribute("studentNo",request.getParameter("studentNo"));
%>
<body background="/LoginInterface/loginFace.jpg">
<div class="container">
    <div class="top">
        欢迎:<%=studentEnity.getStudentName()%> &nbsp;&nbsp;同学<br>
        性别;<%=studentEnity.getSex()%><br>
        班级:<%=studentEnity.getClassName()%><br>
        学院:<%=studentEnity.getCollage()%><br>
    </div>
    <div class="bottom">
        <table class="table table-striped">
           <tr>
               <td>课程编号</td>
               <td>课程名</td>
               <td>任课教师</td>
               <td>进入课程</td>
           </tr>
            <%
                StudentLessonDao studentLessonDao=new StudentLessonDao();
                ArrayList<StudentLessonEnity> list=(ArrayList<StudentLessonEnity>)studentLessonDao.getAllStuLes(studentEnity.getStudentNo());
                if(list!=null){
                    for (StudentLessonEnity temp:list){
                        %>
            <tr>
                <td><%=temp.getCourseNo()%></td>
                <td><%=temp.getCourseName()%></td>
                <td><%=temp.getWorkerName()%></td>
                <td>
                    <form action="StudentLesson.jsp" target="_blank">
                        <input type="hidden" name="courseNo" value="<%=temp.getCourseNo()%>">
                        <input type="hidden" name="workerNo" value="<%=temp.getWorkerNo()%>">
                        <button type="submit" class="btn btn-info">进入课程</button>
                    </form>
                </td>
            </tr>
            <%
                    }
                }
            %>

        </table>
    </div>
</div>
</body>
</html>
